/* 主管理模块 */

import { NgModule }      from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { FormsModule } from '@angular/forms'; // 引入表单包， 寒ngModule
import { RouterModule }   from '@angular/router';

import { AppComponent }  from './app.component';
import { HeroesComponent }  from './heroes.component';
import { HeroDetailComponent }  from './hero-detail.component';
import { DashboardComponent }  from './dashboard.component';
import { AppRoutingModule }   from './app-routing.module'; // 导入 路由模块
import { HeroService } from './hero.service'; // 导入服务模块

@NgModule({
  imports: [
    BrowserModule,
    FormsModule,
    AppRoutingModule,
  ],

  declarations: [
    AppComponent,
    DashboardComponent,
    HeroesComponent,
    HeroDetailComponent,
  ],
  providers: [ // 用来通知Angular创建新组件时,同时创建HeroService
    HeroService
  ],
  bootstrap: [ AppComponent ]
})
export class AppModule { }
